package com.lmx.repoDomain.tmodel;

import javax.persistence.*;

import com.lmx.repoDomain.tmodel.business.User;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;

// default package

import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 通用类型字典表
 */
@Entity
@JsonApiResource(type = "dicttypetenant")
@Table(name = "tnb_tenant_type")
// @JsonIgnoreProperties(value={"hibernateLazyInitializer","handler"})
public class DicttypeTenant extends BaseEntity {

	private String typecode;// 类型编码
	private TypegroupTenant typegroupTenant;// 类型分组
	private String typename;// 类型名称
	private String remark;// 备注

	private String typeValue;// 值
	private User lastUpdateUser;// 更新操作者userid

	private Integer createDateTime;// 创建时间

	private User createUser;

	private Integer lastUpdateDateTime;// 更新时间

	private String totalPrice;//月费 总价格

	@Column(name = "total_price")
	public String getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(String totalPrice) {
		this.totalPrice = totalPrice;
	}
	
	@Column(name = "type_value")
	public String getTypeValue() {
		return typeValue;
	}

	public void setTypeValue(String typeValue) {
		this.typeValue = typeValue;
	}

	@Column(name = "createDateTime")
	public Integer getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Integer createDateTime) {
		this.createDateTime = createDateTime;
	}

	@Column(name = "lastUpdateDateTime")
	public Integer getLastUpdateDateTime() {
		return lastUpdateDateTime;
	}

	public void setLastUpdateDateTime(Integer lastUpdateDateTime) {
		this.lastUpdateDateTime = lastUpdateDateTime;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "createuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "lastupdateuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getLastUpdateUser() {
		return lastUpdateUser;
	}

	public void setLastUpdateUser(User lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "typegroupid", foreignKey = @ForeignKey(name = "null"))
	@Fetch(FetchMode.JOIN)
	public TypegroupTenant getTypegroupTenant() {
		return typegroupTenant;
	}

	public void setTypegroupTenant(final TypegroupTenant typegroupTenant) {
		this.typegroupTenant = typegroupTenant;
	}

	@Column(name = "typename", length = 50)
	public String getTypename() {
		return typename;
	}

	public void setTypename(final String typename) {
		this.typename = typename;
	}

	@Column(name = "typecode", length = 50)
	public String getTypecode() {
		return typecode;
	}

	public void setTypecode(final String typecode) {
		this.typecode = typecode;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}